package com.miyake.client.tools;

public abstract class FormatLabel {
	public abstract boolean isBold();
	public abstract int getHorizontalAlign();
	
	public static final int HORIZONTALALIGN_LEFT  = 0;
	public static final int HORIZONTALALIGN_CENTER  = 1;
	public static final int HORIZONTALALIGN_RIGHT  = 2;
	
	public String getHTML(String text) {
		String html;
		if (isBold()) {
			html = "<b>" + text + "</b>";
		}
		else {
			html = text;
		}
		
		if (getHorizontalAlign() == HORIZONTALALIGN_LEFT) {
			html = "<div align=\"left\">" + html + "</div>" ;
		}
		else if (getHorizontalAlign() == HORIZONTALALIGN_CENTER) {
			html = "<div align=\"center\">" + html + "</div>" ;
		}
		else if (getHorizontalAlign() == HORIZONTALALIGN_RIGHT) {
			html = "<div align=\"right\">" + html + "</div>" ;
		}
		
		return html;
	}
}
